<template>
    <div>
        <el-container style="height: 100vh;">
            <el-header style="background-color: antiquewhite; line-height: 60px;">物业登录</el-header>
            <el-main class="main">
                <el-row>
                    <el-col :span="1" :offset="10">
                        <span style="line-height: 40px;">账号：</span>
                    </el-col>
                    <el-col :span="3">
                        <el-input placeholder="请输入内容" v-model="LoginForm.certifiedAccountAccount"></el-input>
                    </el-col>
                </el-row>
                <el-row style="margin-top: 20px;">
                    <el-col :span="1" :offset="10">
                        <span style="line-height: 40px;">密码：</span>
                    </el-col>
                    <el-col :span="3">
                        <el-input placeholder="请输入内容" v-model="LoginForm.certifiedAccountPass" show-password></el-input>
                    </el-col>
                </el-row>
                <el-row style="margin-top: 40px;">
                    <el-col>
                        <el-button @click="login" type="primary">登录</el-button>
                        <el-button @click="back">返回</el-button>
                        <el-button @click="application">申请成为物业</el-button>
                    </el-col>
                </el-row>
            </el-main>
        </el-container>
    </div>
</template>

<script>
export default {
    name: "Login",
    data() {
        return {
            LoginForm: {
                certifiedAccountAccount: "",
                certifiedAccountPass: ""
            }
        }
    },
    methods: {
        application() {
            this.$router.push('/application')
        },
        back() {
            this.$router.push("/first")
        },
        login() {
            if (this.LoginForm.certifiedAccountAccount == "" || this.LoginForm.certifiedAccountPass == "") {
                alert("请输入账号和密码")
            } else {
                this.$http.post("/certified/certifiedAccount/login", this.LoginForm).then(resp => {
                    alert(resp.data.message)
                    if (resp.data.code == 200) {
                        this.$router.push("/index")
                    }
                })
            }
        }
    },
    created() {

    }

}
</script>

<style scoped>
.main {
    background-image: url("../../static/images/system/33.jpg");
    background-size: 100%;
    overflow: hidden;
}

.loginContainer {
    border-radius: 15px;
    background-clip: padding-box;
    text-align: left;
    margin: auto;
    margin-top: 180px;
    width: 350px;
    padding: 15px 35px 15px 35px;
    background: aliceblue;
    border: 1px solid blueviolet;
    box-shadow: 0 0 25px #55aaff;
    margin-right: 100px;
}
</style>